package com.huichaoliu.adapters;

import java.util.List;

import com.huichaoliu.adapters.FragmentShoppingAdapter.Holder;
import com.huichaoliu.app.R;
import com.huichaoliu.data.UtilInfo;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

public class StylistNotifyAdapter extends BaseAdapter{
	Context context;
	List<UtilInfo> list;
	LayoutInflater inflater;
	
	public StylistNotifyAdapter(Context context,List<UtilInfo> list){
		this.context = context;
		this.list = list;
		inflater = LayoutInflater.from(context);
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return list.size();
	}

	@Override
	public Object getItem(int arg0) {
		// TODO Auto-generated method stub
		return list.get(arg0);
	}

	@Override
	public long getItemId(int arg0) {
		// TODO Auto-generated method stub
		return arg0;
	}

	@Override
	public View getView(int arg0, View arg1, ViewGroup arg2) {
		Holder mHolder;
		if (arg1 == null || arg1.getTag() == null) {
			mHolder = new Holder();
			arg1 = inflater.inflate(R.layout.stylist_notify_item, arg2,
					false);
			mHolder.icon = (ImageView) arg1
					.findViewById(R.id.notify_icon);
			mHolder.time = (TextView) arg1
					.findViewById(R.id.notify_time);
			mHolder.content = (TextView) arg1
					.findViewById(R.id.notify_content);
		} else {
			mHolder = (Holder) arg1.getTag();
		}


		return arg1;
	}

	public class Holder {
		ImageView icon;
		TextView content;
		TextView time;

	}

}
